delete

Purpose

Indicates that a persistent instance should be deleted.

Examples

def book = Book.get(1)
book.delete()

Description

The delete method informs the persistence context that a persistent instance should be deleted. Equivalent to the Hibernate delete method.

Calling delete on a transient instance will result in an error

Parameters:

def book = Book.get(1)
book.delete(flush:true)